<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 伪类选择器：选中的是一个位置 */
        /* p:first-child {
            background-color: red;
        } */
        /* div:last-child {
            background-color: red;
            color: red; 
        }

        */
        /* 
        p:nth-child(3) {
            background-color: red;
        } */

        /* div :only-child {
            background-color: red;
        } */

        /* even:偶数
            odd：奇数
        */
        /* p:nth-child(even) {
            background-color: red;
        } */
        div {
            width: 100px;
            height: 100px;
            background-color: red;
        }

        /* 选中没有子元素的div */
        /* div:empty {
            background-color: aqua;
        } */

        div:not(div:empty) {
            background-color: blue;
        }
    </style>
</head>

<body>
    <div></div>
    <div></div>
    <div></div>
    <div>
        <p>我是p元素</p>
    </div>
</body>

</html>